package com.bwhx.eruler.dao.impl;

import java.util.LinkedList;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.bwhx.eruler.bean.PCustomer;
import com.bwhx.eruler.bean.Page;
import com.bwhx.eruler.dao.PCustomerDAO;

@Repository
public class PCustomerDAOImpl extends BaseDaoImpl<PCustomer> implements PCustomerDAO {

	public PCustomerDAOImpl() {
		this.setNs("com.bwhx.eruler.mapper.PCustomerMapper.");
	}

	
	
	@Override
	public Boolean insertBatch(LinkedList<PCustomer> customerList) {
		int count = getSqlSession().insert(this.getNs() + "insertBatch", customerList);// * @return 成功操作的记录数目
		
		if (count==customerList.size()){
			return true;
		}else{
			return false;
		}
	
		

	}



	@Override
	public List<PCustomer> list(Page p) {
		return getSqlSession().selectList(this.getNs() + "list", p);
	}



	@Override
	public Integer count(PCustomer pCustomer) {
		return getSqlSession().selectOne(this.getNs() + "count", pCustomer);
	}
	
	

}
